package cn.legend.travel.passport.service;


import cn.legend.travel.common.pojo.authentication.CurrentPrincipal;
import cn.legend.travel.passport.pojo.param.UserLoginInfoParam;
import cn.legend.travel.passport.pojo.param.UserRegInfoParam;
import cn.legend.travel.passport.pojo.vo.UserLoginResultVO;
import org.springframework.transaction.annotation.Transactional;

import javax.servlet.http.HttpServletRequest;

@Transactional
public interface IUserService {
    /**
     * 账号密码登录
     * @param userLoginInfoParam
     * @param request
     * @return
     */
    UserLoginResultVO login(UserLoginInfoParam userLoginInfoParam, HttpServletRequest request);

    /**
     * 手机登录
     * @param phone
     * @param request
     * @return
     */
    UserLoginResultVO loginByPhone(String phone, HttpServletRequest request);

    /**
     * 注册
     * @return
     */
    void reg(UserRegInfoParam userRegInfoParam);


    /**
     * 退出登录
     * @return
     */
    void logout(CurrentPrincipal currentPrincipal);

    /**
     * 获取验证码
     * @return
     */
    void send(String phone,String key);

    int compareCode(String phone,String preAuthCode);


}
